package 线程课后习题;

class MyThread2 implements Runnable {
	
	@Override
	public void run() {
		for (int i = 0; i < 20; i++) {
			System.out.println(i + "你好，我来自线程" + Thread.currentThread().getName());
		}
	}
}

public class Test2 {
	public static void main(String[] args) {
		MyThread2 mtd = new MyThread2();
		Thread thread = new Thread(mtd,"线程A");
		Thread thread2 = new Thread(mtd,"线程B");
		thread.start();
		thread2.start();
	}
}
